package com.nuedu.corejava.ch8.homework;

import java.util.Scanner;

public class HomeWork1 {
	public static void main(String[] args) {
		Scanner sanScanner = new Scanner(System.in);
		String[] a = new String[2];
		try {
			System.out.println("请输入被除数");
			a[0] = sanScanner.nextLine();
			System.out.println("请输入除数");
			a[3] = sanScanner.nextLine();
		} catch (IndexOutOfBoundsException e) {
			e.printStackTrace();
		}
		while (true) {
			int c = 0;
			a[0] = sanScanner.nextLine();
			a[1] = sanScanner.nextLine();
			try {
				
				c = Integer.parseInt(a[0]) / (Integer.parseInt(a[1]));
				System.out.println(c);
			} catch (NumberFormatException e) {
				e.printStackTrace();
			} catch (ArithmeticException e) {
				e.printStackTrace();
			} finally {
				System.out.println("总是被执行");
			}
			if (c != 0) {
				break;
			}
		}

	}

}
